package com.zhike.common.dto;

import javax.validation.constraints.NotEmpty;

import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;

/**
 * 消息撤回
 */
@Data
@Slf4j
public class CMDBody4RevokeMessageRequest {

    // 发送发UID
    private String fromUid;

    // 接收方UID
    private String toUid;

    // 指纹码
    private String fp;

    private String msgType;

    private String chatType;

    private String dataContent;

    public static CMDBody4RevokeMessageRequest parseFromSender(String originalMsg) {
        try {
            return new Gson().fromJson(originalMsg, CMDBody4RevokeMessageRequest.class);
        } catch (JsonSyntaxException e) {
            log.error("{}", e);
            return null;
        }
    }
}
